package com.whfc.openapi.api.fvs.controller;

import com.whfc.common.result.Result;
import com.whfc.common.result.ResultUtil;
import com.whfc.openapi.api.fvs.service.FvsTokenService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @Description: 视频监控云平台获取token
 * @author: qzexing
 * @version: 1.0
 * @date: 2020/5/6 11:54
 */
@RestController
@RequestMapping("/open/api/fvs/token")
public class FvsTokenController {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private FvsTokenService fvsTokenService;

    @GetMapping("/ezviz/{deptId}")
    public Result getEzvizToken(@PathVariable Integer deptId) {
        String ezvizToken = fvsTokenService.getEzvizToken(deptId);
        return ResultUtil.success(ezvizToken);
    }

    @GetMapping("/imou/{deptId}")
    public Result getImouToken(@PathVariable Integer deptId) {
        String imouToken = fvsTokenService.getImouToken(deptId);
        return ResultUtil.success(imouToken);
    }


}
